<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/11/1 0001
 * Time: 上午 10:21
 */

namespace app\mobile\controller;

use app\admin\model\CategoryModule;
use app\admin\model\IndexBlock;
use app\admin\model\Slider;
use think\Db;

class Index extends MoBase
{
    public function index(){
        //轮播图
        $slider = Slider::where(['status'=>1])->order('sort asc,id asc')->select()->visible(['thumb','link'])->toArray();
        //导航
        $cate = CategoryModule::getmoindex();
        //新闻标题
        $news_cate = Db::name('index_block')->field('id,title,logo')->find(1);
        //雄厚的教育资源
        $block3 = IndexBlock::index('5');
        //先进的课程体系
        $block4 = IndexBlock::index('6');
        //专业的师资团队
        $block5 = IndexBlock::index('7');
        //丰富的运营经验
        $block6 = IndexBlock::index('8');
        //可靠的安全保障
        $block7 = IndexBlock::index('9');
        //推荐课程
        $block8 = IndexBlock::index('2');
        //博大新闻
        $block9 = IndexBlock::index('1');
        $this->assign([
            'slider'=>$slider,
            'cate'=>$cate,
            'news_cate'=>$news_cate,
            'block3'=>$block3,
            'block4'=>$block4,
            'block5'=>$block5,
            'block6'=>$block6,
            'block7'=>$block7,
            'block8'=>$block8,
            'block9'=>$block9,
        ]);
        return view();
    }
}